/**
 * Copyright (c) 2006-2009 by Shanghai UnuTrip Network Technology Development Co.,Ltd
 * All rights reserved.
 */


package com.unusap.remote.dto;

/**
 * 
 * @author danson
 * AbstractResponse.java
 * 2009-8-19
 */
public abstract class AbstractResponse<T> extends AbstractDTO {

	private boolean result;
	
	private MessagesDTO messages = new MessagesDTO();

	public boolean isResult() {
		return result;
	}

	@SuppressWarnings("unchecked")
	public T setResult(boolean result) {
		this.result = result;
		return (T) this;
	}

	public MessagesDTO getMessages() {
		return messages;
	}

	@SuppressWarnings("unchecked")
	public T setMessages(MessagesDTO messages) {
		this.messages = messages;
		return (T) this;
	}
	
	@SuppressWarnings("unchecked")
	public T addMessage(MessageDTO message) {
		this.messages.addMessage(message);
		return (T) this;
	}
	
}
